package com.example.core.po;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel(value = "树形结构")
public class BaseTreePo<T> extends BasePo {

    @ApiModelProperty(value = "父节点id")
    @TableField(value = "parent_id")
    private String parentId;

    @ApiModelProperty(value = "父节点名称")
    @TableField(value = "parent_name")
    private String parentName;

    @ApiModelProperty(value = "层级")
    @TableField(value = "hierarchy")
    private String hierarchy;

    @ApiModelProperty(value = "排序号")
    @TableField(value = "order_num")
    private int orderNum;

    @ApiModelProperty(value = "默认可选")
    private transient Boolean disabled = false;

    @ApiModelProperty(value = "子节点列表")
    private transient List<BaseTreePo> children = new ArrayList<>();
}
